Applications (e.g., editors) that can be employed to manipulate electronic data (e.g., documents, images, audio . . . ) often utilize a representation of the data to facilitate modifying (e.g., creating, editing, and removing) all or selective portions of the data. With these applications, the representation typically is generated when a user performs an action (e.g., launches an application and opens a document) that indicates a desire to modify the data. The user can employ the representation to indirectly modify the data via the representation, wherein a modification made to the representation is eventually translated to the data.
After a representation is generated, the data can be directly modified. When the data is modified, the representation no longer reflects a current state of the data so the modification needs to be translated to the representation. Similar to above, the modification is eventually translated to the data representation. In addition, other applications can be concurrently invoked to manipulate the data. These applications can work directly on the data, utilize an existing representation or elicit generation of other representations. Likewise, the above noted modifications (made to the representation and data) must be translated to all other representations and any modification to another representation must be translated to the data and its respective representations in order to synchronize the data with associated representations.
Conventionally, modification translation (for the above scenarios) from data or representation to representation or data is delayed. For example, with many applications the user commits changes, for example, after some period of time or upon exiting the application. However, this type of commitment can introduce delay in the translation, which can result in periods where the data does not reflect the representation and the representation does not reflect the data. The foregoing presents several challenges to ensuring the integrity of the data. For example, when data and an associated representation do not reflect each other, the representation can be utilized to make or attempt to make erroneous modification to the data.
For example, a programmer may desire to modify source code. Upon invoking an editor, a representation of the source code can be generated and utilized by the programmer to edit the source code. For example, the programmer may add a method to a class in the representation. However, if the class is removed from the source code after the representation is generated and the representation is not updated to reflect the class removal, the representation can be modified with the addition of the new method, even though the class no longer exists in the source code. When the modification (the new method) to the representation is eventually translated from the representation to the source code, unexpected and/or undesired results may occur. For example, the method can be erroneously translated and not discovered until the source code is compiled, which can necessitate debugging and undoing the modification. In another example, the invalid translation may cause the application to crash or lock-up. In yet another example, the translation may result in lost code or a corrupt file. In still another example, the invalid translation may occur without an indication, wherein running the executable code may render undesired results.